using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmWarehouse")]
    public class Warehouse
    {
        public Warehouse()
        {
            //this.WarehouseConsumes = new HashSet<WarehousePermit>();
            //this.Assets = new HashSet<Asset>();
            //this.Receiveds = new HashSet<Received>();
            //this.Dispenses = new HashSet<Dispense>();
        }
    

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "WhId", ResourceType = typeof(Resources.WarehouseResource))]
        public int WhId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "Name", ResourceType = typeof(Resources.WarehouseResource))]
        public string Name { get; set; }

        [DataMember, Display(Name = "Description", ResourceType = typeof(Resources.WarehouseResource))]
        public string Description { get; set; }

        [CustomRequired]
        [ForeignKey("Scope")]
		[DataMember, Display(Name = "ScopeId", ResourceType = typeof(Resources.WarehouseResource))]
        public int? ScopeId { get; set; }

		[ForeignKey("JobSite")]
		[DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.WarehouseResource))]
        public Nullable<int> JobSiteId { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.WarehouseResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.WarehouseResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.WarehouseResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.WarehouseResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.WarehouseResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        //[DataMember]
        //public virtual ICollection<WarehousePermit> WarehouseConsumes { get; set; }

        //[DataMember]
        //public virtual ICollection<Asset> Assets { get; set; }

        //[DataMember]
        //public virtual ICollection<Received> Receiveds { get; set; }
        
        //[DataMember]
        //public virtual ICollection<Dispense> Dispenses { get; set; }

        [DataMember]
        public virtual IcmMasLookUp Scope { get; set; }

        [DataMember]
        public virtual HRM.JobSite JobSite { get; set; }

    }
}